from django.conf.urls import url
from . import views
from django.contrib.auth import views as auth_views

urlpatterns = [
    # 自定义登录界面
    # url(r'^login/$', views.user_login, name="user_login"),
    # django内置的登录界面
    # url(r'^login/$', auth_views.login, name="user_login"),
    # 指定的自定义登录界面
    url(r'^login/$', auth_views.login, {"template_name": "account/login.html"}, name="user_login"),
    # django内置的退出界面
    # url(r'^logout/$', auth_views.logout, name='user_logout'),
    # 指定的自定义退出界面
    url(r'^logout/$', auth_views.logout, {"template_name": "account/logout.html"}, name='user_logout'),
    # 用户注册界面
    url(r'^register/$', views.register, name="user_register"),
    # 修改密码界面
    url(r'^password-change/$', auth_views.password_change,
        # template_name  使用自己的html页面
        {"template_name": "account/password_change_form.html",
         "post_change_redirect": "/account/password-change-done"}, name='password_change'),
    # 修改密码成功界面
    url(r'^password-change-done', auth_views.password_change_done,
        # template_name  使用自己的html页面
        {"template _name": "account/password_change_done.html"}, name='password_change_done'),
    # 重置密码界面
    url(r'^password-reset/$', auth_views.password_reset,
        {"template_name": "account/password_reset_form.html",
         # 邮箱发送内容
         "email_template_name": "account/password_reset_email.html",
         # 邮箱主题
         "subject_template_name": "account/password_reset_subject.txt",
         "post_reset_redirect": "/account/password-reset-done"}, name="password_reset"),
    # 邮箱发送成功界面
    url(r'^password-reset-done/$', auth_views.password_reset_done,
        {"template_name": "account/password_reset_done.html"}, name="password_reset_done"),
    # 重置密码修改界面
    url(r'^password-reset-confirm/(?P<uidb64>[-\w]+)/(?P<token>[-\w]+)/$', auth_views.password_reset_confirm,
        {"template_name": "account/password_reset_confirm.html",
         "post_reset_redirect": "/account/password-reset-complete"}, name="password_reset_confirm"),
    # 重置密码成功界面
    url(r'^password-reset-complete/$', auth_views.password_reset_complete,
        {"template_name": "account/password_reset_complete.html"}, name="password_reset_complete"),
    # 个人信息界面
    url(r'^my-information/$', views.myself, name="my_information"),
    # 个人信息修改界面
    url(r'^edit-my-information/$', views.myself_edit, name="edit_my_information"),
    # 上传头像图片
    url(r'^my-image/$', views.my_image, name="my_image"),
]
